//
//  XRDataRequestManger.h
//  YWBaseFrameWork
//
//  Created by 余伟 on 2017/1/13.
//  Copyright © 2017年 NeiQuan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"

//访问网络,利用PinCache缓存数据
//一般只处理主界面的数据,二级或之后界面的数据不建议缓存,缓存的数据会很大
//可能会产生Crash
typedef void(^CacheBlock  )(NSDictionary*responseCache);
typedef void(^SuccessBlock)(NSDictionary*response);
typedef void(^FailBlock   )(NSError*error);
@class YeeNetClient;
@interface YeeDataRequestManger : NSObject


//post获取数据
+ (void)postJSONWithUrl:(NSString *)urlStr
             parameters:(id)parameters
                  cache:(BOOL)cache
          responseCache:(CacheBlock)responseCache
                success:(SuccessBlock)success
                   fail:(FailBlock)fail;
//get获取数据
+ (void)getJSONWithUrl:(NSString *)urlStr
             parameters:(id)parameters
                  cache:(BOOL)cache
          responseCache:(CacheBlock)responseCache
                success:(SuccessBlock)success
                   fail:(FailBlock)fail;

@end
